import os
import re
import time
import traceback
import requests
from db_interface import db_interface
from srf_log import logger
import requests
from lxml import etree
import pickle
import random
import datetime
import json


def stock_data_mkv():
    sql = 'select date, mkv from stock_mkv_history'
    query = db_interface.stock_base.select(sql)
    data = {}
    for item in query:
        date, mkv = item
        date = date.strftime('%Y-%m-%d')
        if date not in data:
            data[date] = []
        data[date].append(mkv)

    for k, v in data.items():
        print(k, v)


if __name__ == "__main__":
    stock_data_mkv()
